package edu.suda.xsap.dto.convert;

import edu.suda.xsap.dto.MemberDto;
import edu.suda.xsap.entity.Member;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

import java.util.List;


@Mapper(componentModel = "spring")
public interface MemberConvert {
    @Mapping(source="id", target = "id")
    @Mapping(source="name", target = "memberName")
    @Mapping(source="phone", target = "phoneNum")
    @Mapping(source="birthday", target = "birthdate")
    @Mapping(source="sex", target = "gender")
    @Mapping(source="note", target = "remark")
    @Mapping(source="createtime", target = "date")

    MemberDto toDto(Member member);



    List<MemberDto> toDtoList(List<Member> members);
}
